new Vue({
  el: '#root',

  data: {
    years: [],
    months: [],
    days: [],
  },

  created () {
    this.years = this.getBornYears()
    this.months = this.getBornMonths()
    this.days = this.getBornDays()
  },

  methods: {
    getBornYears () {
      const currentYear = new Date().getFullYear()
      const years = []
      for (let i = currentYear; i >= 1900; i --) {
        years.push(i)
      }
      return years
    },
    getBornMonths() {
      const months = []
      for (let i = 1; i <= 12; i ++) {
        months.push(i)
      }
      return months
    },
    getBornDays() {
      const days = []
      for (let i = 1; i <= 31; i ++) {
        days.push(i)
      }
      return days
    },
    onTapBack () {
      history.go(-1)
    },
    onTapSearch () {
      window.open('./luck-result.html')
    }
  }
})
